﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LoaiSanPhamControl.ascx.cs"
    Inherits="TMDT.Web.UI.Controls.LoaiSanPhamControl" %>
<asp:MultiView runat="server" ID="mtvView">
    <asp:View runat="server" ID="vInsert">
            <table>
                <tr>
                    <td>
                        Tên loại:
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtTenLoaiSanPhamInsert" Text="" CssClass="text"></asp:TextBox>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td>
                        Chủng loại:
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlIDChungLoaiInsert">
                        </asp:DropDownList>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:LinkButton runat="server" ID="lbnInsert" onclick="lbnInsert_Click"><span>Thêm</span></asp:LinkButton>
                    </td>
                </tr>
            </table>

        <table>
            <thead>
                <tr>
                    <th>
                        Sửa
                    </th>
                    <th>
                        STT
                    </th>
                    <th>
                        Tên loại
                    </th>
                    <th>
                        Chủng loại
                    </th>
                    <th>
                        Xóa
                    </th>
                </tr>
            </thead>
            <tbody>
                <asp:Repeater runat="server" ID="rptLoaiSanPham" 
                    onitemdatabound="rptLoaiSanPham_ItemDataBound">
                    <ItemTemplate>
                        <tr>
                            <td>
                                <asp:ImageButton runat="server" ID="ibnEdit" ImageUrl="~/Images/edit.png" CommandArgument='<%# Eval("IDLoaiSanPham")%>' OnClick="ibnEdit_Click"/>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="lblSTT" Text='<%# Container.ItemIndex + 1 %>'></asp:Label>
                            </td>
                            <td>
                                <%# Eval("TenLoaiSanPham") %>
                            </td>
                            <td>
                                <asp:Label ID="lblChungLoai" runat="server" Text=""></asp:Label>
                            </td>
                            <td>
                                <asp:ImageButton runat="server" ID="ibnDelete" ImageUrl="~/Images/delete.png" CommandArgument='<%# Eval("IDLoaiSanPham")%>' OnClick="ibnDelete_Click"/>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <AlternatingItemTemplate>
                        <tr>
                            <td>
                                <asp:ImageButton runat="server" ID="ibnEdit" ImageUrl="~/Images/edit.png" CommandArgument='<%# Eval("IDLoaiSanPham")%>' OnClick="ibnEdit_Click"/>
                            </td>
                            <td>
                                <asp:Label runat="server" ID="lblSTT" Text='<%# Container.ItemIndex + 1 %>'></asp:Label>
                            </td>
                            <td>
                                <%# Eval("TenLoaiSanPham") %>
                            </td>
                            <td>
                                <asp:Label ID="lblChungLoai" runat="server" Text=""></asp:Label>
                            </td>
                            <td>
                                <asp:ImageButton runat="server" ID="ibnDelete" ImageUrl="~/Images/delete.png" CommandArgument='<%# Eval("IDLoaiSanPham")%>' OnClick="ibnDelete_Click"/>
                            </td>
                        </tr>
                    </AlternatingItemTemplate>
                </asp:Repeater>
            </tbody>
        </table>
    </asp:View>
    <asp:View runat="server" ID="vUpdate">
        <table>
            <tr>
                <td>
                    Tên loại:
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtTenLoaiSanPhamUpdate" Text="" CssClass="text"> </asp:TextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    Chủng loại:
                </td>
                <td>
                    <asp:DropDownList runat="server" ID="ddlIDChungLoaiUpdate">
                    </asp:DropDownList>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:LinkButton runat="server" ID="lbnUpdate" onclick="lbnUpdate_Click"><span>Cập nhật</span></asp:LinkButton>
                    &nbsp;&nbsp;
                    <asp:LinkButton
                        runat="server" ID="lbnCancel" onclick="lbnCancel_Click"><span>Trở về</span></asp:LinkButton>
                </td>
            </tr>
        </table>
    </asp:View>
</asp:MultiView>
